import java.io.*;

public class input {

    public static void main(String[] args) throws IOException {
        String filePath="C:\\Users\\22453\\Desktop\\test.txt";
        File f=new File(filePath);
        InputStream stream=new FileInputStream(f);
        InputStream inputStream=new FileInputStream(new File(filePath));//装饰器
        byte[]bytes=new byte[20];
        stream.read(bytes);//读文件
        String content =new String(bytes);//转换
        System.out.println(content);
        stream.close();//关闭

    }
}
